import request from "@/utils/request.ts";


export function getArticlePageUrl(params: any) {
    return request({
        url: '/blog/articles/list',
        method: 'get',
        params: params
    })
}

/**
 * 获取对应的所有文章信息
 * @param params
 * @param params.artCategoryId 所在专栏 id
 * @returns 文章列表
 */
export function getAllArticlePageUrl(params: any) {
    return request({
        url: '/blog/articles/allList',
        method: 'get',
        params: params
    })
}


export function getArticleInfoByIdUrl(params: any) {
    return request({
        url: '/blog/articles/getArticleById',
        method: 'get',
        params: params
    })
}

export function addArticleUrl(data: any) {
    return request({
        url: '/blog/articles/add',
        method: 'post',
        data: data
    })
}

/**
 * 修改文章
 * @param data
 */
export function editArticleUrl(data: any) {
    return request({
        url: '/blog/articles/update',
        method: 'put',
        data: data
    })
}

export function removeArticleByIdUrl(params: any) {
    return request({
        url: '/blog/articles/delete',
        method: 'delete',
        params: params
    })
}


/**
 * 根据 id 获取文章下面的所有图片并查看使用情况
 * @param artId 文章 id
 */
export function getArtPictureByIdUrl(artId: any) {
    return request({
        url: '/blog/articles/artPictureById',
        method: 'get',
        params: {artId: artId}
    })
}
